# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
class ApiConfig:
    # 安全配置项
    security = {
        # 令牌数量限制
        "token_limit": 100,
        # 令牌过期时间
        "token_timeout": 7200,
        # 令牌续签期限
        "token_renewal": 1800,
        # 支持并发登录
        "is_concurrent": True,
        # 缓存前缀名称
        "cache_prefix": "login:api_"
    }

    # 免登录验证
    not_need_login = [
        "weixin:reply",
        "login:qrcode",
        "login:ticket",
        "login:logout",
        "login:register",
        "login:oa_login",
        "login:mobile_login",
        "login:account_login",

        "payment:notify_mnp",
        "payment:notify_ali",
        "user:forget_pwd",
        "user:bind_wechat",

        "index:diy",
        "index:homing",
        "index:models",
        "index:config",
        "index:policy",
        "index:send_sms",
        "index:send_email",
        "test:index",

        "square:setting",
        "square:category",
        "square:robot",
        "square:video",
        "square:music",

        "v1:chat:clear",
        "v1:chat:history",
        "v1:files:upload",
        "v1:publish:verify",
        "v1:chat:completions",

        "agent:chat:rooming:init",
        "apply:draws:record:lists",
        "apply:draws:prompt:example",
        "apply:draws:prompt:category",
        "apply:draws:drawing:config",
        "apply:draws:drawing:notify_mj",
        "apply:docs:files:prompts",
        "apply:docs:files:lists",
        "apply:video:config",
        "apply:video:record",
        "apply:music:config",
        "apply:music:styles",
        "apply:music:record",
    ]

    # 记日志足迹
    log_need_write = [
        "login:logout",
        "login:register",
        "login:oa_login",
        "login:mobile_login",
        "login:account_login",

        "index:config",
        "square:robot",
        "square:draws",
        "recharge:package",
        "subscribe:package",

        "user:center",
        "user:edit",
        "user:forget_pwd",
        "user:change_pwd",
        "user:bind_mobile",
        "user:bind_email",
        "user:bind_wechat"
    ]
